<template>
  <div class="model-form">
    <el-page-header @back="goBack" content="更新订单">
    </el-page-header>
    <div class="model-content">
      <el-form ref="ruleForm" :rules="rules" :model="form" label-width="160px">
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="订单状态" prop="state">
              <el-input v-model="form.state" name="state">
              </el-input>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="订单数量" prop="num">
              <el-input v-model="form.num" name="num">
              </el-input>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="下单人" prop="customerId">
              <el-input v-model="form.customerId" name="customerId">
              </el-input>
            </el-form-item>

          </el-col>
          <el-col :span="12">
            <el-form-item label="订单金额" prop="amount">
              <el-input v-model="form.amount" name="amount">
              </el-input>
            </el-form-item>

          </el-col>

          <el-col :span="22">
            <el-form-item>
              <el-button @click="goBack">取消</el-button>
              <el-button type="primary" @click="updateData">确定</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
  </div>
</template>

<script setup>
import nbSelect from "@/components/nbSelect.vue";
import {ref} from "vue";
import {useData} from "@/utils/useData";
import {useUpdate} from "@/uses/useUpdate";

const form = ref({
  state: '',
  num: '',
  customerId: '',
  amount: ''
})

const rules = ref({})

const ruleForm = ref(null);

const {updateData, goBack} = useUpdate("order", form, ruleForm)

</script>

<style scoped>

</style>
